home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q31603 < prev    next >
Text File  |  1988-07-20  |  941b  |  37 lines

  1. Q31603 Fprintf to stdprn appears to be buffered
  2. C Compiler
  3. 5.10
  4. MS-DOS
  5.  
  6. Summary:
  7.    Fprintf to stdprn functions differently in C Version 5.10 than it
  8. did in Version 5.00. The following program displays the difference:
  9.  
  10.      #include <stdio.h>
  11.      main()
  12.      {
  13.          int i;
  14.          for (i=0;i<10;i++)
  15.           {
  16.            fprintf(stdprn,"99\r\n");
  17.           }
  18.          getch();
  19.         }
  20.  
  21. More Information:
  22.    When this program is run under C Version 5.00, "99" is printed 10
  23. times before it waits for keyboard input. When run under C Version
  24. 5.10, the program waits for keyboard input, then prints "99" 10 times.
  25.    To make Version 5.10 behave the same as 5.00, insert the following
  26. line of code just prior to the for loop:
  27.  
  28.    setbuf(stdprn, NULL);
  29.  
  30.    Microsoft is researching this problem and will post new information
  31. as it becomes available.
  32.  
  33.  
  34.  
  35. Keywords:  buglist5.10
  36. Updated  88/07/21 03:19
  37.